#include "read_boy_confg.h"
#include "read_boy_test.h"
#include "read_boy.h"

//#include "read_boy_base.h"

//#include "readboy_epd_4_2B.h"
void my_drv_base_init();

uint8_t read_one_byte_read_boy_fb(uint32_t num);
void test_fb();
void read_boy_test_main(){
    //EPD_GPIOInit();	
    readboyEpdBase_GPIOInit();
    //my_readboyEpdBase_init();
    my_drv_base_init();
    
    
    my_drv_base.drv_setDepth(1);
    
    my_drv_base.drv_fullpart(0);
    
    
    test_fb();
    
    my_drv_base.drv_dispWriter(&read_boy_fb_read_one_byte,my_drv_base._quality);
    
    DelayMs(2000);	
    
    
    my_drv_base.drv_fullpart(0);
    read_boy_fb_clear();
    my_drv_base.drv_dispWriter(&read_boy_fb_read_one_byte,my_drv_base._quality);
    
    //4.2b
#if defined(READ_BOY_DEV_4_2B)     
    my_drv_base.drv_setDepth(15);
        //read_boy_fb_clear();
        read_boy_fb_fillRect(0,0,400,300);
        my_drv_base.drv_dispWriter(&read_boy_fb_read_one_byte,my_drv_base._quality);
     DelayMs(1000);	 
    my_drv_base.drv_setDepth(15);
        read_boy_fb_clear();
        //read_boy_fb_fillRect(0,0,400,300);
     my_drv_base.drv_dispWriter(&read_boy_fb_read_one_byte,my_drv_base._quality);
     DelayMs(1000);	      
#endif    
    my_drv_base.drv_fullpart(1);
    for(int i = 1; i < 16;i++){
        
        my_drv_base.drv_setDepth(i);
        //read_boy_fb_clear();
        read_boy_fb_fillRect(10,10*i,20,10);
        read_boy_draw_str_en(40,10*i,read_boy_FONT_6x8,"arm-2d");
        my_drv_base.drv_dispWriter(&read_boy_fb_read_one_byte,my_drv_base._quality);
        //DelayMs(500);	
    }
    
    DelayMs(5000);

    my_drv_base.drv_fullpart(0);
    read_boy_fb_clear();
    my_drv_base.drv_dispWriter(&read_boy_fb_read_one_byte,my_drv_base._quality);
    DelayMs(400);
    //4.2b
#if defined(READ_BOY_DEV_4_2B)     
    read_boy_fb_fillRect(0,0,400,300);
        my_drv_base.drv_dispWriter(&read_boy_fb_read_one_byte,my_drv_base._quality);
    DelayMs(400);
    read_boy_fb_clear();
    my_drv_base.drv_dispWriter(&read_boy_fb_read_one_byte,my_drv_base._quality);
    DelayMs(400);
#endif    
    my_drv_base.drv_fullpart(1);
    my_drv_base.drv_setDepth(15);
    read_boy_fb_clear();
    my_drv_base.drv_dispWriter(&read_boy_fb_read_one_byte,my_drv_base._quality);
    
//    my_drv_base.drv_sleep();
//    
//    my_drv_base.drv_setDepth(15);
//    
//    my_drv_base.drv_fullpart(0);
//    read_boy_fb_clear();
//    my_drv_base.drv_dispWriter(&read_boy_fb_read_one_byte,my_drv_base._quality);
//    
//    DelayMs(2000);
    //drvSSD168x_drv_dispWriter(&read_one_byte_read_boy_fb,1);
    //drvSSD168x_drv_draw16grey_step(&read_one_byte_read_boy_fb,1);
}











